import java.util.Scanner;

public class Test {
    public static void hannio(int x,String pas1,String pas2,String pas3){
        if(x==1){
            move(pas1,pas2);
        }else {
            hannio(x-1,pas1,pas3,pas2);
            move(pas1,pas2);
            hannio(x-1,pas2,pas1,pas3);
        }

    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();;
        hannio(n,"A","B","C");
        sc.close();
    }
    public static void move(String start,String destination){
        System.out.println(start+"-->"+destination);
    }
}
